package com.tianji.learning.excel.easyexcel;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.tianji.learning.excel.easyexcel.conveter.AnonymityConverter;
import lombok.Data;

import java.time.LocalDateTime;

@Data
@HeadRowHeight(30)
@ContentRowHeight(20)
public class QuestionExcelModel {
    @ColumnWidth(30)
    @ExcelProperty("互动问题名称")
    private String title;

    @ColumnWidth(10)
    @ExcelProperty("回答数量")
    private Integer answerTimes;

    @ColumnWidth(22)
    @ExcelProperty("创建时间")
    private LocalDateTime createTime;

    @ColumnWidth(20)
    @ExcelProperty(value = "是否匿名提问",converter = AnonymityConverter.class)
    private Boolean anonymity;

    @ExcelIgnore
    private String anonymityStr;

    @ColumnWidth(16)
    @ExcelProperty("提问者昵称")
    private String userName;

    @ColumnWidth(20)
    @ExcelProperty("最新回答信息")
    private String latestReplyContent;

    @ColumnWidth(25)
    @ExcelProperty("最新回答者昵称")
    private String latestReplyUser;
}